Primitive Value:  Infinity

Infinity

In ECMAScript, Infinity is classified as a primitive value.

Infinity is a numeric value that represents positive infinity. It is displayed, or printed out, when a very large positive number exceeds the upper limit of the floating point numbers type which is 1.7976931348623157E+10308.

-Infinity is a numeric value that represents negative infinity. It is displayed, or printed out, when a very large negative number exceeds the lower limit of the floating point numbers type which is -1.7976931348623157E+10308.

Also see number.NEGATIVE_INFINITY and number.POSITIVE_INFINITY.

Code:
BigPosNum = 1.5E+339 * 2.4E+317
document.write("BigPosNum = " + BigPosNum)

Output:
BigNum = Infinity

Code:
BigNegNum = -1.5E+333
document.write("BigNegNum = " + BigNegNum)

Output:
BigNegNum = -Infinity

NOTE:

In JavaScript, all numbers, including integers, are treated as floating point numbers.

Copyright 2000 by Infinite Software Solutions, Inc.
Trademark Information